package file;

import java.io.File;

public class ListFileDemo {
    public static void main(String[] args) {
        File dir = new File(".");
        if(dir.isDirectory()){
            System.out.println(dir.getName()+"：是一个目录");
        }
        File [] subs =dir.listFiles();
        System.out.println(subs.length+"个子项");
        for (File sub:subs) {
            System.out.println(sub.getName());
        }
    }
}
